#!/bin/sh
#
# $Header: /ext/src/lss/src/scripts/RCS/nsservers.sh,v 1.6 1997/03/13 16:27:49 bert Exp $
#
CDROM="$1"

#
# extract next parameter directly following -d
#
DIRS=`ps -ef | fgrep "httpd " | fgrep -v fgrep | while read line
do
   echo "$line" | sed 's/.*-d //' | awk '{print $1;}'
done | sort -u`

#
# check DIRS, for configuration files
#
for dir in $DIRS
do
   config_file=$dir/magnus.conf

   if [ -f $config_file ]
   then
      ADDRESS=`fgrep -i Address $config_file | awk '{print $2}'`
      SERVERNAME="`$CDROM/bin/lookup $ADDRESS`"
      if [ ! -z "$SERVERNAME" ]
      then
         echo "$config_file:$SERVERNAME"
      fi
   fi
done
